//
//  VJUploadFileTool.m
//  VJRichTextEditor
//
//  Created by 王佩璇 on 2024/6/12.
//  Copyright © 2024 vj. All rights reserved.
//

#import "VJUploadFileTool.h"

@implementation VJUploadFileTool
-(void)upLoadFileModel:(NSString *)key Callback:(void(^)(NSString *key, float percent,id _Nullable obj,NSError * _Nullable error))callback{
    ///MARK:模拟网络请求上传图片
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        if (callback) {
            callback(key,0.1,nil,nil);
        }
    });
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.35 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        if (callback) {
            callback(key,0.35,nil,nil);
        }
    });
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.55 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        if (callback) {
            callback(key,0.55,nil,nil);
        }
    });
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.75 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        if (callback) {
            callback(key,0.75,nil,nil);
        }
    });
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        if (callback) {
            callback(key,1,@"上传成功",nil);
        }
    });
    
}
@end
